﻿<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
  
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Struct Pair&lt;TFirst, TSecond&gt;
   </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="Struct Pair&lt;TFirst, TSecond&gt;
   ">
    <meta name="generator" content="docfx 2.56.4.0">
    
    <link rel="shortcut icon" href="../favicon.ico">
    <link rel="stylesheet" href="../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../styles/docfx.css">
    <link rel="stylesheet" href="../styles/main.css">
    <meta property="docfx:navrel" content="../toc.html">
    <meta property="docfx:tocrel" content="toc.html">
    
    
    
  </head>
  <body data-spy="scroll" data-target="#affix" data-offset="120">
    <div id="wrapper">
      <header>
        
        <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
          <div class="container">
            <div class="navbar-header">
              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
              </button>
              
              <a class="navbar-brand" href="../index.html">
                <img id="logo" class="svg" src="../logo.svg" alt="">
              </a>
            </div>
            <div class="collapse navbar-collapse" id="navbar">
              <form class="navbar-form navbar-right" role="search" id="search">
                <div class="form-group">
                  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
                </div>
              </form>
            </div>
          </div>
        </nav>
        
        <div class="subnav navbar navbar-default">
          <div class="container hide-when-search" id="breadcrumb">
            <ul class="breadcrumb">
              <li></li>
            </ul>
          </div>
        </div>
      </header>
      <div role="main" class="container body-content hide-when-search">
        
        <div class="sidenav hide-when-search">
          <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
          <div class="sidetoggle collapse" id="sidetoggle">
            <div id="sidetoc"></div>
          </div>
        </div>
        <div class="article row grid-right">
          <div class="col-md-10">
            <article class="content wrap" id="_content" data-uid="Wintellect.PowerCollections.Pair`2">
  
  
  <h1 id="Wintellect_PowerCollections_Pair_2" data-uid="Wintellect.PowerCollections.Pair`2" class="text-break">Struct Pair&lt;TFirst, TSecond&gt;
  </h1>
  <div class="markdown level0 summary"><p>Stores a pair of objects within a single struct. This struct is useful to use as the
T of a collection, or as the TKey or TValue of a dictionary.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div classs="implements">
    <h5>Implements</h5>
    <div><span class="xref">System.IComparable</span></div>
    <div><span class="xref">System.IComparable</span>&lt;<a class="xref" href="Wintellect.PowerCollections.Pair-2.html">Pair</a>&lt;TFirst, TSecond&gt;&gt;</div>
  </div>
  <div class="inheritedMembers">
    <h5>Inherited Members</h5>
    <div>
      <span class="xref">System.Object.Equals(System.Object, System.Object)</span>
    </div>
    <div>
      <span class="xref">System.Object.GetType()</span>
    </div>
    <div>
      <span class="xref">System.Object.ReferenceEquals(System.Object, System.Object)</span>
    </div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="Wintellect.PowerCollections.html">Wintellect.PowerCollections</a></h6>
  <h6><strong>Assembly</strong>: CADability.dll</h6>
  <h5 id="Wintellect_PowerCollections_Pair_2_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">[Serializable]
public struct Pair&lt;TFirst, TSecond&gt; : IComparable, IComparable&lt;Pair&lt;TFirst, TSecond&gt;&gt;</code></pre>
  </div>
  <h5 class="typeParameters">Type Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="parametername">TFirst</span></td>
        <td></td>
      </tr>
      <tr>
        <td><span class="parametername">TSecond</span></td>
        <td></td>
      </tr>
    </tbody>
  </table>
  <h3 id="constructors">Constructors
  </h3>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/SOFAgh/CADability/new/master/apiSpec/new?filename=Wintellect_PowerCollections_Pair_2__ctor__0__1_.md&amp;value=---%0Auid%3A%20Wintellect.PowerCollections.Pair%602.%23ctor(%600%2C%601)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/SOFAgh/CADability/blob/master/CADability/Pair.cs/#L47">View Source</a>
  </span>
  <a id="Wintellect_PowerCollections_Pair_2__ctor_" data-uid="Wintellect.PowerCollections.Pair`2.#ctor*"></a>
  <h4 id="Wintellect_PowerCollections_Pair_2__ctor__0__1_" data-uid="Wintellect.PowerCollections.Pair`2.#ctor(`0,`1)">Pair(TFirst, TSecond)</h4>
  <div class="markdown level1 summary"><p>Creates a new pair with given first and second elements.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public Pair(TFirst first, TSecond second)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">TFirst</span></td>
        <td><span class="parametername">first</span></td>
        <td><p>The first element of the pair.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">TSecond</span></td>
        <td><span class="parametername">second</span></td>
        <td><p>The second element of the pair.</p>
</td>
      </tr>
    </tbody>
  </table>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/SOFAgh/CADability/new/master/apiSpec/new?filename=Wintellect_PowerCollections_Pair_2__ctor_System_Collections_Generic_KeyValuePair__0__1__.md&amp;value=---%0Auid%3A%20Wintellect.PowerCollections.Pair%602.%23ctor(System.Collections.Generic.KeyValuePair%7B%600%2C%601%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/SOFAgh/CADability/blob/master/CADability/Pair.cs/#L58">View Source</a>
  </span>
  <a id="Wintellect_PowerCollections_Pair_2__ctor_" data-uid="Wintellect.PowerCollections.Pair`2.#ctor*"></a>
  <h4 id="Wintellect_PowerCollections_Pair_2__ctor_System_Collections_Generic_KeyValuePair__0__1__" data-uid="Wintellect.PowerCollections.Pair`2.#ctor(System.Collections.Generic.KeyValuePair{`0,`1})">Pair(KeyValuePair&lt;TFirst, TSecond&gt;)</h4>
  <div class="markdown level1 summary"><p>Creates a new pair using elements from a KeyValuePair structure. The
First element gets the Key, and the Second elements gets the Value.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public Pair(KeyValuePair&lt;TFirst, TSecond&gt; keyAndValue)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Collections.Generic.KeyValuePair</span>&lt;TFirst, TSecond&gt;</td>
        <td><span class="parametername">keyAndValue</span></td>
        <td><p>The KeyValuePair to initialize the Pair with .</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="fields">Fields
  </h3>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/SOFAgh/CADability/new/master/apiSpec/new?filename=Wintellect_PowerCollections_Pair_2_First.md&amp;value=---%0Auid%3A%20Wintellect.PowerCollections.Pair%602.First%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/SOFAgh/CADability/blob/master/CADability/Pair.cs/#L35">View Source</a>
  </span>
  <h4 id="Wintellect_PowerCollections_Pair_2_First" data-uid="Wintellect.PowerCollections.Pair`2.First">First</h4>
  <div class="markdown level1 summary"><p>The first element of the pair.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public TFirst First</code></pre>
  </div>
  <h5 class="fieldValue">Field Value</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">TFirst</span></td>
        <td></td>
      </tr>
    </tbody>
  </table>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/SOFAgh/CADability/new/master/apiSpec/new?filename=Wintellect_PowerCollections_Pair_2_Second.md&amp;value=---%0Auid%3A%20Wintellect.PowerCollections.Pair%602.Second%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/SOFAgh/CADability/blob/master/CADability/Pair.cs/#L40">View Source</a>
  </span>
  <h4 id="Wintellect_PowerCollections_Pair_2_Second" data-uid="Wintellect.PowerCollections.Pair`2.Second">Second</h4>
  <div class="markdown level1 summary"><p>The second element of the pair.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public TSecond Second</code></pre>
  </div>
  <h5 class="fieldValue">Field Value</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">TSecond</span></td>
        <td></td>
      </tr>
    </tbody>
  </table>
  <h3 id="methods">Methods
  </h3>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/SOFAgh/CADability/new/master/apiSpec/new?filename=Wintellect_PowerCollections_Pair_2_CompareTo_Wintellect_PowerCollections_Pair__0__1__.md&amp;value=---%0Auid%3A%20Wintellect.PowerCollections.Pair%602.CompareTo(Wintellect.PowerCollections.Pair%7B%600%2C%601%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/SOFAgh/CADability/blob/master/CADability/Pair.cs/#L125">View Source</a>
  </span>
  <a id="Wintellect_PowerCollections_Pair_2_CompareTo_" data-uid="Wintellect.PowerCollections.Pair`2.CompareTo*"></a>
  <h4 id="Wintellect_PowerCollections_Pair_2_CompareTo_Wintellect_PowerCollections_Pair__0__1__" data-uid="Wintellect.PowerCollections.Pair`2.CompareTo(Wintellect.PowerCollections.Pair{`0,`1})">CompareTo(Pair&lt;TFirst, TSecond&gt;)</h4>
  <div class="markdown level1 summary"><p> Compares this pair to another pair of the some type. The pairs are compared by using
the IComparable&lt;T> or IComparable interface on TFirst and TSecond. The pairs
are compared by their first elements first, if their first elements are equal, then they
are compared by their second elements.</p>
<p>If either TFirst or TSecond does not implement IComparable&lt;T> or IComparable, then
an NotSupportedException is thrown, because the pairs cannot be compared.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public int CompareTo(Pair&lt;TFirst, TSecond&gt; other)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><a class="xref" href="Wintellect.PowerCollections.Pair-2.html">Pair</a>&lt;TFirst, TSecond&gt;</td>
        <td><span class="parametername">other</span></td>
        <td><p>The pair to compare to.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><p>An integer indicating how this pair compares to <code data-dev-comment-type="paramref" class="paramref">other</code>. Less
than zero indicates this pair is less than <code data-dev-comment-type="paramref" class="paramref">other</code>. Zero indicate this pair is
equals to <code data-dev-comment-type="paramref" class="paramref">other</code>. Greater than zero indicates this pair is greater than
<code data-dev-comment-type="paramref" class="paramref">other</code>.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="exceptions">Exceptions</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Condition</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.NotSupportedException</span></td>
        <td><p>Either FirstSecond or TSecond is not comparable
via the IComparable&lt;T&gt; or IComparable interfaces.</p>
</td>
      </tr>
    </tbody>
  </table>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/SOFAgh/CADability/new/master/apiSpec/new?filename=Wintellect_PowerCollections_Pair_2_Equals_System_Object_.md&amp;value=---%0Auid%3A%20Wintellect.PowerCollections.Pair%602.Equals(System.Object)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/SOFAgh/CADability/blob/master/CADability/Pair.cs/#L71">View Source</a>
  </span>
  <a id="Wintellect_PowerCollections_Pair_2_Equals_" data-uid="Wintellect.PowerCollections.Pair`2.Equals*"></a>
  <h4 id="Wintellect_PowerCollections_Pair_2_Equals_System_Object_" data-uid="Wintellect.PowerCollections.Pair`2.Equals(System.Object)">Equals(Object)</h4>
  <div class="markdown level1 summary"><p>Determines if this pair is equal to another object. The pair is equal to another object
if that object is a Pair, both element types are the same, and the first and second elements
both compare equal using object.Equals.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public override bool Equals(object obj)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Object</span></td>
        <td><span class="parametername">obj</span></td>
        <td><p>Object to compare for equality.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Boolean</span></td>
        <td><p>True if the objects are equal. False if the objects are not equal.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="overrides">Overrides</h5>
  <div><span class="xref">System.ValueType.Equals(System.Object)</span></div>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/SOFAgh/CADability/new/master/apiSpec/new?filename=Wintellect_PowerCollections_Pair_2_Equals_Wintellect_PowerCollections_Pair__0__1__.md&amp;value=---%0Auid%3A%20Wintellect.PowerCollections.Pair%602.Equals(Wintellect.PowerCollections.Pair%7B%600%2C%601%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/SOFAgh/CADability/blob/master/CADability/Pair.cs/#L91">View Source</a>
  </span>
  <a id="Wintellect_PowerCollections_Pair_2_Equals_" data-uid="Wintellect.PowerCollections.Pair`2.Equals*"></a>
  <h4 id="Wintellect_PowerCollections_Pair_2_Equals_Wintellect_PowerCollections_Pair__0__1__" data-uid="Wintellect.PowerCollections.Pair`2.Equals(Wintellect.PowerCollections.Pair{`0,`1})">Equals(Pair&lt;TFirst, TSecond&gt;)</h4>
  <div class="markdown level1 summary"><p>Determines if this pair is equal to another pair. The pair is equal if  the first and second elements
both compare equal using IComparable&lt;T&gt;.Equals or object.Equals.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public bool Equals(Pair&lt;TFirst, TSecond&gt; other)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><a class="xref" href="Wintellect.PowerCollections.Pair-2.html">Pair</a>&lt;TFirst, TSecond&gt;</td>
        <td><span class="parametername">other</span></td>
        <td><p>Pair to compare with for equality.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Boolean</span></td>
        <td><p>True if the pairs are equal. False if the pairs are not equal.</p>
</td>
      </tr>
    </tbody>
  </table>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/SOFAgh/CADability/new/master/apiSpec/new?filename=Wintellect_PowerCollections_Pair_2_GetHashCode.md&amp;value=---%0Auid%3A%20Wintellect.PowerCollections.Pair%602.GetHashCode%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/SOFAgh/CADability/blob/master/CADability/Pair.cs/#L102">View Source</a>
  </span>
  <a id="Wintellect_PowerCollections_Pair_2_GetHashCode_" data-uid="Wintellect.PowerCollections.Pair`2.GetHashCode*"></a>
  <h4 id="Wintellect_PowerCollections_Pair_2_GetHashCode" data-uid="Wintellect.PowerCollections.Pair`2.GetHashCode">GetHashCode()</h4>
  <div class="markdown level1 summary"><p>Returns a hash code for the pair, suitable for use in a hash-table or other hashed collection.
Two pairs that compare equal (using Equals) will have the same hash code. The hash code for
the pair is derived by combining the hash codes for each of the two elements of the pair.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public override int GetHashCode()</code></pre>
  </div>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><p>The hash code.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="overrides">Overrides</h5>
  <div><span class="xref">System.ValueType.GetHashCode()</span></div>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/SOFAgh/CADability/new/master/apiSpec/new?filename=Wintellect_PowerCollections_Pair_2_ToKeyValuePair.md&amp;value=---%0Auid%3A%20Wintellect.PowerCollections.Pair%602.ToKeyValuePair%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/SOFAgh/CADability/blob/master/CADability/Pair.cs/#L232">View Source</a>
  </span>
  <a id="Wintellect_PowerCollections_Pair_2_ToKeyValuePair_" data-uid="Wintellect.PowerCollections.Pair`2.ToKeyValuePair*"></a>
  <h4 id="Wintellect_PowerCollections_Pair_2_ToKeyValuePair" data-uid="Wintellect.PowerCollections.Pair`2.ToKeyValuePair">ToKeyValuePair()</h4>
  <div class="markdown level1 summary"><p>Converts this Pair to a KeyValuePair. The Key part of the KeyValuePair gets
the First element, and the Value part of the KeyValuePair gets the Second
elements.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public KeyValuePair&lt;TFirst, TSecond&gt; ToKeyValuePair()</code></pre>
  </div>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Collections.Generic.KeyValuePair</span>&lt;TFirst, TSecond&gt;</td>
        <td><p>The KeyValuePair created from this Pair.</p>
</td>
      </tr>
    </tbody>
  </table>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/SOFAgh/CADability/new/master/apiSpec/new?filename=Wintellect_PowerCollections_Pair_2_ToString.md&amp;value=---%0Auid%3A%20Wintellect.PowerCollections.Pair%602.ToString%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/SOFAgh/CADability/blob/master/CADability/Pair.cs/#L185">View Source</a>
  </span>
  <a id="Wintellect_PowerCollections_Pair_2_ToString_" data-uid="Wintellect.PowerCollections.Pair`2.ToString*"></a>
  <h4 id="Wintellect_PowerCollections_Pair_2_ToString" data-uid="Wintellect.PowerCollections.Pair`2.ToString">ToString()</h4>
  <div class="markdown level1 summary"><p>Returns a string representation of the pair. The string representation of the pair is
of the form:
<code>First: {0}, Second: {1}</code>
where {0} is the result of First.ToString(), and {1} is the result of Second.ToString() (or
&quot;null&quot; if they are null.)</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public override string ToString()</code></pre>
  </div>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.String</span></td>
        <td><p>The string representation of the pair.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="overrides">Overrides</h5>
  <div><span class="xref">System.ValueType.ToString()</span></div>
  <h3 id="operators">Operators
  </h3>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/SOFAgh/CADability/new/master/apiSpec/new?filename=Wintellect_PowerCollections_Pair_2_op_Equality_Wintellect_PowerCollections_Pair__0__1__Wintellect_PowerCollections_Pair__0__1__.md&amp;value=---%0Auid%3A%20Wintellect.PowerCollections.Pair%602.op_Equality(Wintellect.PowerCollections.Pair%7B%600%2C%601%7D%2CWintellect.PowerCollections.Pair%7B%600%2C%601%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/SOFAgh/CADability/blob/master/CADability/Pair.cs/#L197">View Source</a>
  </span>
  <a id="Wintellect_PowerCollections_Pair_2_op_Equality_" data-uid="Wintellect.PowerCollections.Pair`2.op_Equality*"></a>
  <h4 id="Wintellect_PowerCollections_Pair_2_op_Equality_Wintellect_PowerCollections_Pair__0__1__Wintellect_PowerCollections_Pair__0__1__" data-uid="Wintellect.PowerCollections.Pair`2.op_Equality(Wintellect.PowerCollections.Pair{`0,`1},Wintellect.PowerCollections.Pair{`0,`1})">Equality(Pair&lt;TFirst, TSecond&gt;, Pair&lt;TFirst, TSecond&gt;)</h4>
  <div class="markdown level1 summary"><p>Determines if two pairs are equal. Two pairs are equal if  the first and second elements
both compare equal using IComparable&lt;T&gt;.Equals or object.Equals.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static bool operator ==(Pair&lt;TFirst, TSecond&gt; pair1, Pair&lt;TFirst, TSecond&gt; pair2)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><a class="xref" href="Wintellect.PowerCollections.Pair-2.html">Pair</a>&lt;TFirst, TSecond&gt;</td>
        <td><span class="parametername">pair1</span></td>
        <td><p>First pair to compare.</p>
</td>
      </tr>
      <tr>
        <td><a class="xref" href="Wintellect.PowerCollections.Pair-2.html">Pair</a>&lt;TFirst, TSecond&gt;</td>
        <td><span class="parametername">pair2</span></td>
        <td><p>Second pair to compare.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Boolean</span></td>
        <td><p>True if the pairs are equal. False if the pairs are not equal.</p>
</td>
      </tr>
    </tbody>
  </table>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/SOFAgh/CADability/new/master/apiSpec/new?filename=Wintellect_PowerCollections_Pair_2_op_Explicit_System_Collections_Generic_KeyValuePair__0__1___Wintellect_PowerCollections_Pair__0__1_.md&amp;value=---%0Auid%3A%20Wintellect.PowerCollections.Pair%602.op_Explicit(System.Collections.Generic.KeyValuePair%7B%600%2C%601%7D)~Wintellect.PowerCollections.Pair%7B%600%2C%601%7D%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/SOFAgh/CADability/blob/master/CADability/Pair.cs/#L243">View Source</a>
  </span>
  <a id="Wintellect_PowerCollections_Pair_2_op_Explicit_" data-uid="Wintellect.PowerCollections.Pair`2.op_Explicit*"></a>
  <h4 id="Wintellect_PowerCollections_Pair_2_op_Explicit_System_Collections_Generic_KeyValuePair__0__1___Wintellect_PowerCollections_Pair__0__1_" data-uid="Wintellect.PowerCollections.Pair`2.op_Explicit(System.Collections.Generic.KeyValuePair{`0,`1})~Wintellect.PowerCollections.Pair{`0,`1}">Explicit(KeyValuePair&lt;TFirst, TSecond&gt; to Pair&lt;TFirst, TSecond&gt;)</h4>
  <div class="markdown level1 summary"><p>Converts a KeyValuePair structure into a Pair. The
First element gets the Key, and the Second element gets the Value.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static explicit operator Pair&lt;TFirst, TSecond&gt;(KeyValuePair&lt;TFirst, TSecond&gt; keyAndValue)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Collections.Generic.KeyValuePair</span>&lt;TFirst, TSecond&gt;</td>
        <td><span class="parametername">keyAndValue</span></td>
        <td><p>The KeyValuePair to convert.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><a class="xref" href="Wintellect.PowerCollections.Pair-2.html">Pair</a>&lt;TFirst, TSecond&gt;</td>
        <td><p>The Pair created by converted the KeyValuePair into a Pair.</p>
</td>
      </tr>
    </tbody>
  </table>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/SOFAgh/CADability/new/master/apiSpec/new?filename=Wintellect_PowerCollections_Pair_2_op_Explicit_Wintellect_PowerCollections_Pair__0__1___System_Collections_Generic_KeyValuePair__0__1_.md&amp;value=---%0Auid%3A%20Wintellect.PowerCollections.Pair%602.op_Explicit(Wintellect.PowerCollections.Pair%7B%600%2C%601%7D)~System.Collections.Generic.KeyValuePair%7B%600%2C%601%7D%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/SOFAgh/CADability/blob/master/CADability/Pair.cs/#L221">View Source</a>
  </span>
  <a id="Wintellect_PowerCollections_Pair_2_op_Explicit_" data-uid="Wintellect.PowerCollections.Pair`2.op_Explicit*"></a>
  <h4 id="Wintellect_PowerCollections_Pair_2_op_Explicit_Wintellect_PowerCollections_Pair__0__1___System_Collections_Generic_KeyValuePair__0__1_" data-uid="Wintellect.PowerCollections.Pair`2.op_Explicit(Wintellect.PowerCollections.Pair{`0,`1})~System.Collections.Generic.KeyValuePair{`0,`1}">Explicit(Pair&lt;TFirst, TSecond&gt; to KeyValuePair&lt;TFirst, TSecond&gt;)</h4>
  <div class="markdown level1 summary"><p>Converts a Pair to a KeyValuePair. The Key part of the KeyValuePair gets
the First element, and the Value part of the KeyValuePair gets the Second
elements.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static explicit operator KeyValuePair&lt;TFirst, TSecond&gt;(Pair&lt;TFirst, TSecond&gt; pair)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><a class="xref" href="Wintellect.PowerCollections.Pair-2.html">Pair</a>&lt;TFirst, TSecond&gt;</td>
        <td><span class="parametername">pair</span></td>
        <td><p>Pair to convert.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Collections.Generic.KeyValuePair</span>&lt;TFirst, TSecond&gt;</td>
        <td><p>The KeyValuePair created from <code data-dev-comment-type="paramref" class="paramref">pair</code>.</p>
</td>
      </tr>
    </tbody>
  </table>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/SOFAgh/CADability/new/master/apiSpec/new?filename=Wintellect_PowerCollections_Pair_2_op_Inequality_Wintellect_PowerCollections_Pair__0__1__Wintellect_PowerCollections_Pair__0__1__.md&amp;value=---%0Auid%3A%20Wintellect.PowerCollections.Pair%602.op_Inequality(Wintellect.PowerCollections.Pair%7B%600%2C%601%7D%2CWintellect.PowerCollections.Pair%7B%600%2C%601%7D)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/SOFAgh/CADability/blob/master/CADability/Pair.cs/#L209">View Source</a>
  </span>
  <a id="Wintellect_PowerCollections_Pair_2_op_Inequality_" data-uid="Wintellect.PowerCollections.Pair`2.op_Inequality*"></a>
  <h4 id="Wintellect_PowerCollections_Pair_2_op_Inequality_Wintellect_PowerCollections_Pair__0__1__Wintellect_PowerCollections_Pair__0__1__" data-uid="Wintellect.PowerCollections.Pair`2.op_Inequality(Wintellect.PowerCollections.Pair{`0,`1},Wintellect.PowerCollections.Pair{`0,`1})">Inequality(Pair&lt;TFirst, TSecond&gt;, Pair&lt;TFirst, TSecond&gt;)</h4>
  <div class="markdown level1 summary"><p>Determines if two pairs are not equal. Two pairs are equal if  the first and second elements
both compare equal using IComparable&lt;T&gt;.Equals or object.Equals.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static bool operator !=(Pair&lt;TFirst, TSecond&gt; pair1, Pair&lt;TFirst, TSecond&gt; pair2)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><a class="xref" href="Wintellect.PowerCollections.Pair-2.html">Pair</a>&lt;TFirst, TSecond&gt;</td>
        <td><span class="parametername">pair1</span></td>
        <td><p>First pair to compare.</p>
</td>
      </tr>
      <tr>
        <td><a class="xref" href="Wintellect.PowerCollections.Pair-2.html">Pair</a>&lt;TFirst, TSecond&gt;</td>
        <td><span class="parametername">pair2</span></td>
        <td><p>Second pair to compare.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Boolean</span></td>
        <td><p>True if the pairs are not equal. False if the pairs are equal.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="eii">Explicit Interface Implementations
  </h3>
  <span class="small pull-right mobile-hide">
    <span class="divider">|</span>
    <a href="https://github.com/SOFAgh/CADability/new/master/apiSpec/new?filename=Wintellect_PowerCollections_Pair_2_System_IComparable_CompareTo_System_Object_.md&amp;value=---%0Auid%3A%20Wintellect.PowerCollections.Pair%602.System%23IComparable%23CompareTo(System.Object)%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A">Improve this Doc</a>
  </span>
  <span class="small pull-right mobile-hide">
    <a href="https://github.com/SOFAgh/CADability/blob/master/CADability/Pair.cs/#L169">View Source</a>
  </span>
  <a id="Wintellect_PowerCollections_Pair_2_System_IComparable_CompareTo_" data-uid="Wintellect.PowerCollections.Pair`2.System#IComparable#CompareTo*"></a>
  <h4 id="Wintellect_PowerCollections_Pair_2_System_IComparable_CompareTo_System_Object_" data-uid="Wintellect.PowerCollections.Pair`2.System#IComparable#CompareTo(System.Object)">IComparable.CompareTo(Object)</h4>
  <div class="markdown level1 summary"><p> Compares this pair to another pair of the some type. The pairs are compared by using
the IComparable&lt;T> or IComparable interface on TFirst and TSecond. The pairs
are compared by their first elements first, if their first elements are equal, then they
are compared by their second elements.</p>
<p>If either TFirst or TSecond does not implement IComparable&lt;T> or IComparable, then
an NotSupportedException is thrown, because the pairs cannot be compared.</p>
</div>
  <div class="markdown level1 conceptual"></div>
  <h5 class="decalaration">Declaration</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">int IComparable.CompareTo(object obj)</code></pre>
  </div>
  <h5 class="parameters">Parameters</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Object</span></td>
        <td><span class="parametername">obj</span></td>
        <td><p>The pair to compare to.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="returns">Returns</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.Int32</span></td>
        <td><p>An integer indicating how this pair compares to <code data-dev-comment-type="paramref" class="paramref">obj</code>. Less
than zero indicates this pair is less than <code data-dev-comment-type="paramref" class="paramref">other</code>. Zero indicate this pair is
equals to <code data-dev-comment-type="paramref" class="paramref">obj</code>. Greater than zero indicates this pair is greater than
<code data-dev-comment-type="paramref" class="paramref">obj</code>.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h5 class="exceptions">Exceptions</h5>
  <table class="table table-bordered table-striped table-condensed">
    <thead>
      <tr>
        <th>Type</th>
        <th>Condition</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><span class="xref">System.ArgumentException</span></td>
        <td><p><code data-dev-comment-type="paramref" class="paramref">obj</code> is not of the correct type.</p>
</td>
      </tr>
      <tr>
        <td><span class="xref">System.NotSupportedException</span></td>
        <td><p>Either FirstSecond or TSecond is not comparable
via the IComparable&lt;T&gt; or IComparable interfaces.</p>
</td>
      </tr>
    </tbody>
  </table>
  <h3 id="implements">Implements</h3>
  <div>
      <span class="xref">System.IComparable</span>
  </div>
  <div>
      <span class="xref">System.IComparable&lt;T&gt;</span>
  </div>
</article>
          </div>
          
          <div class="hidden-sm col-md-2" role="complementary">
            <div class="sideaffix">
              <div class="contribution">
                <ul class="nav">
                  <li>
                    <a href="https://github.com/SOFAgh/CADability/new/master/apiSpec/new?filename=Wintellect_PowerCollections_Pair_2.md&amp;value=---%0Auid%3A%20Wintellect.PowerCollections.Pair%602%0Asummary%3A%20'*You%20can%20override%20summary%20for%20the%20API%20here%20using%20*MARKDOWN*%20syntax'%0A---%0A%0A*Please%20type%20below%20more%20information%20about%20this%20API%3A*%0A%0A" class="contribution-link">Improve this Doc</a>
                  </li>
                  <li>
                    <a href="https://github.com/SOFAgh/CADability/blob/master/CADability/Pair.cs/#L18" class="contribution-link">View Source</a>
                  </li>
                </ul>
              </div>
              <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
                <h5>In This Article</h5>
                <div></div>
              </nav>
            </div>
          </div>
        </div>
      </div>
      
      <footer>
        <div class="grad-bottom"></div>
        <div class="footer">
          <div class="container">
            <span class="pull-right">
              <a href="#top">Back to top</a>
            </span>
            
            <span>Generated by <strong>DocFX</strong></span>
          </div>
        </div>
      </footer>
    </div>
    
    <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
    <script type="text/javascript" src="../styles/docfx.js"></script>
    <script type="text/javascript" src="../styles/main.js"></script>
  </body>
</html>
